using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using THSERP.BusinessEntities;
using THSERP.BaseProvider;
namespace THSERP.Modules.ProjectConfig
{
    public class ProjectConfigModule : BaseModuleERP
    {
        public ProjectConfigModule()
        {
            Name = "ProjectConfig";
            CurrentModuleEntity = new ProjectConfigEntities();
            CurrentModuleEntity.Module = this;
            InitializeModule();
        }

        #region Phase Types Screen
        public void AddItemToPMPhaseTypesList()
        {
            ProjectConfigEntities entity = (ProjectConfigEntities)CurrentModuleEntity;
            entity.PMPhaseTypesList.AddObjectToList();
        }

        public void ChangeItemFromPMPhaseTypesList()
        {
            ProjectConfigEntities entity = (ProjectConfigEntities)CurrentModuleEntity;
            entity.PMPhaseTypesList.ChangeObjectFromList();
        }

        public void DeleteItemFromPMPhaseTypesList()
        {
            ProjectConfigEntities entity = (ProjectConfigEntities)CurrentModuleEntity;
            entity.PMPhaseTypesList.RemoveSelectedRowObjectFromList();
        }

        public void SavePMPhaseTypeItems()
        {
            ProjectConfigEntities entity = (ProjectConfigEntities)CurrentModuleEntity;
            entity.PMPhaseTypesList.SaveItemObjects(true);
            MessageBox.Show("Save successfully.", "#Message#", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        #endregion
    }
}
